/*
 * telaJogo.java
 *
 * Created on 16 de Dezembro de 2006, 04:09
 */

package magchess10.ClassesIU;

import java.awt.Color;
import java.util.Hashtable;
import java.util.Timer;
import java.util.TimerTask;

import javax.swing.JLabel;

import magchess10.rn.controle.ControleJogo;
import magchess10.rn.controle.ControleRelogio;
import magchess10.rn.tabuleiro.Casa;

/**
 *
 * @author  User
 */
public class TelaJogo extends javax.swing.JFrame {
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JLabel [][] c_casasTabuleiroPrincipal;
    private JLabel [][] c_casasTabuleiroSecundario;
    private JLabel [][] c_repositoriosJogadores ;
    private ControleJogo c_controleJogo;
    private final static int JOGADORPRINCIPAL = 0;
    private final static int JOGADORADVERSARIO = 1;
    private final static int JOGADORDUPLA = 3 ;
    private final static int JOGADORDUPLAADVERSARIA = 2;
    private String c_corBaixo, c_corCima;
    private Hashtable c_hashTabuleiros;
    private ControleRelogio controleRelogio;
    
    private Timer [] c_relogiosJogo;
    private TimerTask [] c_tarefasRelogios;
    private JLabel [] lblRelogios ;
    
    /** Creates new form telaJogo */
    public TelaJogo(ControleJogo p_controleJogo, String p_corBaixo) {
        
        initComponents();
        setControleJogo(p_controleJogo);
        associarCasasPrincipal();
        associarCasasSecundario();
        associarRepositoriosJogador();
        associarTempoJogadores();
        definirTempoInicial();
        definirNomesJogadores();
        definirCores(p_corBaixo);
        associarHashTabuleiros();
        montarTabuleiros("Secundario");
        montarTabuleiros("Principal");
        adicionarReiRainha();
        associarTempoJogadores();
        controleRelogio = new ControleRelogio (lblRelogios,getControleJogo());
        
        
        
    }
    protected void definirCores(String p_corBaixo) {
        c_corBaixo = p_corBaixo;
        c_corCima = (c_corBaixo == "Branca" ? "Preta" : "Branca");
        
    }
    
    
    
    protected ControleJogo getControleJogo() {
        return c_controleJogo;
    }
    

    
    
    
            
        
        
        
       
    
    
    private void associarHashTabuleiros() {
        c_hashTabuleiros = new Hashtable();
        c_hashTabuleiros.put("Principal",c_casasTabuleiroPrincipal);
        c_hashTabuleiros.put("Secundario", c_casasTabuleiroSecundario);
    }
    
    private boolean verificarTurnoJogadorAlvo(int p_numeroJogador) {
        return c_controleJogo.getTurnoJogadorAlvo(p_numeroJogador);
    }
    
    protected void setControleJogo(ControleJogo p_controleJogo) {
        c_controleJogo = p_controleJogo;
    }
    
    
    private void associarCasasPrincipal() {
        c_casasTabuleiroPrincipal= new JLabel [8][8];
        c_casasTabuleiroPrincipal[0][0] = prinA1;c_casasTabuleiroPrincipal[0][1] = prinB1;c_casasTabuleiroPrincipal[0][2] = prinC1;c_casasTabuleiroPrincipal[0][3] = prinD1;c_casasTabuleiroPrincipal[0][4] = prinE1;
        c_casasTabuleiroPrincipal[0][5] = prinF1;c_casasTabuleiroPrincipal[0][6] = prinG1;c_casasTabuleiroPrincipal[0][7] = prinH1;c_casasTabuleiroPrincipal[1][0] = prinA2;c_casasTabuleiroPrincipal[1][1] = prinB2;
        c_casasTabuleiroPrincipal[1][2] = prinC2;c_casasTabuleiroPrincipal[1][3] = prinD2;c_casasTabuleiroPrincipal[1][4] = prinE2;c_casasTabuleiroPrincipal[1][5] = prinF2;c_casasTabuleiroPrincipal[1][6] = prinG2;
        c_casasTabuleiroPrincipal[1][7] = prinH2;c_casasTabuleiroPrincipal[2][0] = prinA3;c_casasTabuleiroPrincipal[2][1] = prinB3;c_casasTabuleiroPrincipal[2][2] = prinC3;c_casasTabuleiroPrincipal[2][3] = prinD3;
        c_casasTabuleiroPrincipal[2][4] = prinE3;c_casasTabuleiroPrincipal[2][5] = prinF3;c_casasTabuleiroPrincipal[2][6] = prinG3;c_casasTabuleiroPrincipal[2][7] = prinH3;c_casasTabuleiroPrincipal[3][0] = prinA4;
        c_casasTabuleiroPrincipal[3][1] = prinB4;c_casasTabuleiroPrincipal[3][2] = prinC4;c_casasTabuleiroPrincipal[3][3] = prinD4;c_casasTabuleiroPrincipal[3][4] = prinE4;c_casasTabuleiroPrincipal[3][5] = prinF4;
        c_casasTabuleiroPrincipal[3][6] = prinG4;c_casasTabuleiroPrincipal[3][7] = prinH4;c_casasTabuleiroPrincipal[4][0] = prinA5;c_casasTabuleiroPrincipal[4][1] = prinB5;c_casasTabuleiroPrincipal[4][2] = prinC5;
        c_casasTabuleiroPrincipal[4][3] = prinD5;c_casasTabuleiroPrincipal[4][4] = prinE5;c_casasTabuleiroPrincipal[4][5] = prinF5;c_casasTabuleiroPrincipal[4][6] = prinG5;c_casasTabuleiroPrincipal[4][7] = prinH5;
        c_casasTabuleiroPrincipal[5][0] = prinA6;c_casasTabuleiroPrincipal[5][1] = prinB6;c_casasTabuleiroPrincipal[5][2] = prinC6;c_casasTabuleiroPrincipal[5][3] = prinD6;c_casasTabuleiroPrincipal[5][4] = prinE6;
        c_casasTabuleiroPrincipal[5][5] = prinF6;c_casasTabuleiroPrincipal[5][6] = prinG6;c_casasTabuleiroPrincipal[5][7] = prinH6;c_casasTabuleiroPrincipal[6][0] = prinA7;c_casasTabuleiroPrincipal[6][1] = prinB7;
        c_casasTabuleiroPrincipal[6][2] = prinC7;c_casasTabuleiroPrincipal[6][3] = prinD7;c_casasTabuleiroPrincipal[6][4] = prinE7;c_casasTabuleiroPrincipal[6][5] = prinF7;c_casasTabuleiroPrincipal[6][6] = prinG7;
        c_casasTabuleiroPrincipal[6][7] = prinH7;c_casasTabuleiroPrincipal[7][0] = prinA8;c_casasTabuleiroPrincipal[7][1] = prinB8;c_casasTabuleiroPrincipal[7][2] = prinC8;c_casasTabuleiroPrincipal[7][3] = prinD8;
        c_casasTabuleiroPrincipal[7][4] = prinE8;c_casasTabuleiroPrincipal[7][5] = prinF8;c_casasTabuleiroPrincipal[7][6] = prinG8;c_casasTabuleiroPrincipal[7][7] = prinH8;
    }
    
    private void associarCasasSecundario() {
        c_casasTabuleiroSecundario = new JLabel [8][8];
        c_casasTabuleiroSecundario[0][0] = secA1;c_casasTabuleiroSecundario[0][1] = secB1;c_casasTabuleiroSecundario[0][2] = secC1;c_casasTabuleiroSecundario[0][3] = secD1;c_casasTabuleiroSecundario[0][4] = secE1;
        c_casasTabuleiroSecundario[0][5] = secF1;c_casasTabuleiroSecundario[0][6] = secG1;c_casasTabuleiroSecundario[0][7] = secH1;c_casasTabuleiroSecundario[1][0] = secA2;c_casasTabuleiroSecundario[1][1] = secB2;
        c_casasTabuleiroSecundario[1][2] = secC2;c_casasTabuleiroSecundario[1][3] = secD2;c_casasTabuleiroSecundario[1][4] = secE2;c_casasTabuleiroSecundario[1][5] = secF2;c_casasTabuleiroSecundario[1][6] = secG2;
        c_casasTabuleiroSecundario[1][7] = secH2;c_casasTabuleiroSecundario[2][0] = secA3;c_casasTabuleiroSecundario[2][1] = secB3;c_casasTabuleiroSecundario[2][2] = secC3;c_casasTabuleiroSecundario[2][3] = secD3;
        c_casasTabuleiroSecundario[2][4] = secE3;c_casasTabuleiroSecundario[2][5] = secF3;c_casasTabuleiroSecundario[2][6] = secG3;c_casasTabuleiroSecundario[2][7] = secH3;c_casasTabuleiroSecundario[3][0] = secA4;
        c_casasTabuleiroSecundario[3][1] = secB4;c_casasTabuleiroSecundario[3][2] = secC4;c_casasTabuleiroSecundario[3][3] = secD4;c_casasTabuleiroSecundario[3][4] = secE4;c_casasTabuleiroSecundario[3][5] = secF4;
        c_casasTabuleiroSecundario[3][6] = secG4;c_casasTabuleiroSecundario[3][7] = secH4;c_casasTabuleiroSecundario[4][0] = secA5;c_casasTabuleiroSecundario[4][1] = secB5;c_casasTabuleiroSecundario[4][2] = secC5;
        c_casasTabuleiroSecundario[4][3] = secD5;c_casasTabuleiroSecundario[4][4] = secE5;c_casasTabuleiroSecundario[4][5] = secF5;c_casasTabuleiroSecundario[4][6] = secG5;c_casasTabuleiroSecundario[4][7] = secH5;
        c_casasTabuleiroSecundario[5][0] = secA6;c_casasTabuleiroSecundario[5][1] = secB6;c_casasTabuleiroSecundario[5][2] = secC6;c_casasTabuleiroSecundario[5][3] = secD6;c_casasTabuleiroSecundario[5][4] = secE6;
        c_casasTabuleiroSecundario[5][5] = secF6;c_casasTabuleiroSecundario[5][6] = secG6;c_casasTabuleiroSecundario[5][7] = secH6;c_casasTabuleiroSecundario[6][0] = secA7;c_casasTabuleiroSecundario[6][1] = secB7;
        c_casasTabuleiroSecundario[6][2] = secC7;c_casasTabuleiroSecundario[6][3] = secD7;c_casasTabuleiroSecundario[6][4] = secE7;c_casasTabuleiroSecundario[6][5] = secF7;c_casasTabuleiroSecundario[6][6] = secG7;
        c_casasTabuleiroSecundario[6][7] = secH7;c_casasTabuleiroSecundario[7][0] = secA8;c_casasTabuleiroSecundario[7][1] = secB8;c_casasTabuleiroSecundario[7][2] = secC8;c_casasTabuleiroSecundario[7][3] = secD8;
        c_casasTabuleiroSecundario[7][4] = secE8;c_casasTabuleiroSecundario[7][5] = secF8;c_casasTabuleiroSecundario[7][6] = secG8;c_casasTabuleiroSecundario[7][7] = secH8;
    }
    
    private void associarRepositoriosJogador() {
        c_repositoriosJogadores = new JLabel [4][5];
        c_repositoriosJogadores[0][0] = peaoJogador0;c_repositoriosJogadores[0][1] = cavaloJogador0;c_repositoriosJogadores[0][2] = bispoJogador0;c_repositoriosJogadores[0][3] = torreJogador0;
        c_repositoriosJogadores[0][4] = damaJogador0;c_repositoriosJogadores[1][0] = peaoJogador1;c_repositoriosJogadores[1][1] = cavaloJogador1;c_repositoriosJogadores[1][2] = bispoJogador1;c_repositoriosJogadores[1][3] = torreJogador1;
        c_repositoriosJogadores[1][4] = damaJogador1;c_repositoriosJogadores[2][0] = peaoJogador2;c_repositoriosJogadores[2][1] = cavaloJogador2;c_repositoriosJogadores[2][2] = bispoJogador2;c_repositoriosJogadores[2][3] = torreJogador2;
        c_repositoriosJogadores[2][4] = damaJogador2;c_repositoriosJogadores[3][0] = peaoJogador3;c_repositoriosJogadores[3][1] = cavaloJogador3;c_repositoriosJogadores[3][2] = bispoJogador3;c_repositoriosJogadores[3][3] = torreJogador3;
        c_repositoriosJogadores[3][4] = damaJogador3;
        
        
        
        
        
        
        
        
    }
    
    private void definirNomesJogadores() {
        lblNomeJogador1.setText(c_controleJogo.getNomeJogadores(JOGADORPRINCIPAL));
        lblNomeJogador2.setText(c_controleJogo.getNomeJogadores(JOGADORADVERSARIO));
        lblNomeJogador3.setText(c_controleJogo.getNomeJogadores(JOGADORDUPLA));
        lblNomeJogador4.setText(c_controleJogo.getNomeJogadores(JOGADORDUPLAADVERSARIA));
        lbl2NomeJogador1.setText(c_controleJogo.getNomeJogadores(JOGADORPRINCIPAL));
        lbl2NomeJogador2.setText(c_controleJogo.getNomeJogadores(JOGADORADVERSARIO));
        lbl2NomeJogador3.setText(c_controleJogo.getNomeJogadores(JOGADORDUPLA));
        lbl2NomeJogador4.setText(c_controleJogo.getNomeJogadores(JOGADORDUPLAADVERSARIA));
    }
    
    private void associarTempoJogadores() {
        lblRelogios = new JLabel[4];
        lblRelogios [0] = lblTempoJogador0;
        lblRelogios [1] = lblTempoJogador1;
        lblRelogios [2] = lblTempoJogador2 ;
        lblRelogios [3] = lblTempoJogador3 ;
    }
    
    private void definirTempoInicial() {
        for (int i=0; i<4; i++) {
        	lblRelogios[i].setText(String.valueOf(c_controleJogo.getTempoJogadores(i)/60));
        }
    }
    
    private void montarTabuleiros(String p_tipoTabuleiro) {
        adicionarPecas(p_tipoTabuleiro,"Peao",0,1,1,6);
        adicionarPecas(p_tipoTabuleiro,"Cavalo",1,5,0,7);
        adicionarPecas(p_tipoTabuleiro,"Bispo",2,3,0,7);
        adicionarPecas(p_tipoTabuleiro,"Torre",0,7,0,7);
        
        
        
    }
    
    private void adicionarReiRainha() {
        
        if (c_corBaixo == "Branca") {
            adicionarPecas("Principal","Rainha",3,8,0,7);
            adicionarPecas("Principal","Rei",4,8,0,7);
            adicionarPecas("Secundario","Rainha",4,8,0,7);
            adicionarPecas("Secundario","Rei",3,8,0,7);
        } else {
            adicionarPecas("Principal","Rainha",4,8,0,7);
            adicionarPecas("Principal","Rei",3,8,0,7);
            adicionarPecas("Secundario","Rainha",3,8,0,7);
            adicionarPecas("Secundario","Rei",4,8,0,7);
        }
    }
    
    
    
    private void adicionarPecas(String p_tipoTabuleiro, String p_nomePeca , int p_colunaInicial , int p_incremento, int p_linhaBaixo, int p_linhaCima) {
        JLabel [][] l_tabuleiroAtual = (JLabel[][] )c_hashTabuleiros.get(p_tipoTabuleiro);
        for (;p_colunaInicial < 8; p_colunaInicial+=p_incremento) {
            l_tabuleiroAtual[p_linhaBaixo][p_colunaInicial].setIcon(new javax.swing.ImageIcon(getClass().getResource(montaStringPeca(p_linhaBaixo,p_colunaInicial,p_tipoTabuleiro,p_nomePeca))));
            l_tabuleiroAtual[p_linhaCima][p_colunaInicial].setIcon(new javax.swing.ImageIcon(getClass().getResource(montaStringPeca(p_linhaCima,p_colunaInicial,p_tipoTabuleiro,p_nomePeca))));
        }
    }
    
    
    
    private String montaStringPeca(int p_linhaAtual,int p_colunaAtual,String p_tipoTabuleiro, String p_tipoPeca) {
        return "/magchess10/ImagensTabuleiro" + p_tipoTabuleiro + "/" +p_tipoPeca + getCorPeca(p_tipoTabuleiro,p_linhaAtual) + getCorCasa(p_colunaAtual,p_linhaAtual) + ".jpg";
    }
    
    private String getCorPeca(String p_tipoTabuleiro, int p_linhaAtual) {
        if (p_linhaAtual > 4 )
            return (p_tipoTabuleiro == "Secundario" ? c_corBaixo : c_corCima);
        else
            return (p_tipoTabuleiro == "Secundario" ? c_corCima : c_corBaixo);
    }
    
    private String getCorCasa(int p_colunaAtual, int p_linhaAtual) {
        if (p_linhaAtual %2 ==0)
            return (p_colunaAtual %2 ==0 ? "Black" : "White");
        else
            return (p_colunaAtual %2 !=0 ? "Black" : "White");
        
    }
    
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        jPanel2 = new javax.swing.JPanel();
        secA1 = new javax.swing.JLabel();
        secB1 = new javax.swing.JLabel();
        secC1 = new javax.swing.JLabel();
        secD1 = new javax.swing.JLabel();
        secE1 = new javax.swing.JLabel();
        secF1 = new javax.swing.JLabel();
        secG1 = new javax.swing.JLabel();
        secH1 = new javax.swing.JLabel();
        secG2 = new javax.swing.JLabel();
        secF2 = new javax.swing.JLabel();
        secE2 = new javax.swing.JLabel();
        secD2 = new javax.swing.JLabel();
        secC2 = new javax.swing.JLabel();
        secB2 = new javax.swing.JLabel();
        secA2 = new javax.swing.JLabel();
        secH2 = new javax.swing.JLabel();
        secA3 = new javax.swing.JLabel();
        secA4 = new javax.swing.JLabel();
        secB4 = new javax.swing.JLabel();
        secB3 = new javax.swing.JLabel();
        secC3 = new javax.swing.JLabel();
        secC4 = new javax.swing.JLabel();
        secD4 = new javax.swing.JLabel();
        secD3 = new javax.swing.JLabel();
        secE4 = new javax.swing.JLabel();
        secE3 = new javax.swing.JLabel();
        secF4 = new javax.swing.JLabel();
        secF3 = new javax.swing.JLabel();
        secG4 = new javax.swing.JLabel();
        secG3 = new javax.swing.JLabel();
        secH3 = new javax.swing.JLabel();
        secH4 = new javax.swing.JLabel();
        secA5 = new javax.swing.JLabel();
        secA6 = new javax.swing.JLabel();
        secB6 = new javax.swing.JLabel();
        secB5 = new javax.swing.JLabel();
        secC5 = new javax.swing.JLabel();
        secC6 = new javax.swing.JLabel();
        secD6 = new javax.swing.JLabel();
        secD5 = new javax.swing.JLabel();
        secE6 = new javax.swing.JLabel();
        secE5 = new javax.swing.JLabel();
        secF6 = new javax.swing.JLabel();
        secF5 = new javax.swing.JLabel();
        secG6 = new javax.swing.JLabel();
        secG5 = new javax.swing.JLabel();
        secH5 = new javax.swing.JLabel();
        secH6 = new javax.swing.JLabel();
        secA7 = new javax.swing.JLabel();
        secA8 = new javax.swing.JLabel();
        secB8 = new javax.swing.JLabel();
        secB7 = new javax.swing.JLabel();
        secC7 = new javax.swing.JLabel();
        secC8 = new javax.swing.JLabel();
        secD8 = new javax.swing.JLabel();
        secD7 = new javax.swing.JLabel();
        secE8 = new javax.swing.JLabel();
        secE7 = new javax.swing.JLabel();
        secF8 = new javax.swing.JLabel();
        secF7 = new javax.swing.JLabel();
        secG8 = new javax.swing.JLabel();
        secG7 = new javax.swing.JLabel();
        secH7 = new javax.swing.JLabel();
        secH8 = new javax.swing.JLabel();
        jLabel145 = new javax.swing.JLabel();
        jLabel146 = new javax.swing.JLabel();
        jLabel147 = new javax.swing.JLabel();
        jLabel148 = new javax.swing.JLabel();
        jLabel149 = new javax.swing.JLabel();
        jLabel150 = new javax.swing.JLabel();
        jLabel151 = new javax.swing.JLabel();
        jLabel152 = new javax.swing.JLabel();
        jLabel169 = new javax.swing.JLabel();
        jLabel170 = new javax.swing.JLabel();
        jLabel171 = new javax.swing.JLabel();
        jLabel172 = new javax.swing.JLabel();
        jLabel173 = new javax.swing.JLabel();
        jLabel174 = new javax.swing.JLabel();
        jLabel175 = new javax.swing.JLabel();
        jLabel176 = new javax.swing.JLabel();
        jLabel155 = new javax.swing.JLabel();
        lbl2NomeJogador3 = new javax.swing.JLabel();
        lbl2NomeJogador4 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jPanel6 = new javax.swing.JPanel();
        lblMsgBP = new javax.swing.JTextField();
        btnEnviarMsg = new javax.swing.JButton();
        lblTextoBP = new javax.swing.JLabel();
        repJogador0 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        torreJogador0 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        peaoJogador0 = new javax.swing.JLabel();
        bispoJogador0 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        cavaloJogador0 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        damaJogador0 = new javax.swing.JLabel();
        jPanel9 = new javax.swing.JPanel();
        lblNomeJogador2 = new javax.swing.JLabel();
        lblNomeJogador1 = new javax.swing.JLabel();
        lblTempoJogador0 = new javax.swing.JLabel();
        lblEhTurnoJogador1 = new javax.swing.JLabel();
        lblTempoJogador1 = new javax.swing.JLabel();
        lblEhTurnoJogador2 = new javax.swing.JLabel();
        jPanel10 = new javax.swing.JPanel();
        prinG1 = new javax.swing.JLabel();
        prinF1 = new javax.swing.JLabel();
        prinE1 = new javax.swing.JLabel();
        prinD1 = new javax.swing.JLabel();
        prinH1 = new javax.swing.JLabel();
        prinC1 = new javax.swing.JLabel();
        prinB1 = new javax.swing.JLabel();
        prinA1 = new javax.swing.JLabel();
        prinA3 = new javax.swing.JLabel();
        prinB3 = new javax.swing.JLabel();
        prinC3 = new javax.swing.JLabel();
        prinD3 = new javax.swing.JLabel();
        prinE3 = new javax.swing.JLabel();
        prinF3 = new javax.swing.JLabel();
        prinG3 = new javax.swing.JLabel();
        prinH3 = new javax.swing.JLabel();
        prinA2 = new javax.swing.JLabel();
        prinB2 = new javax.swing.JLabel();
        prinC2 = new javax.swing.JLabel();
        prinD2 = new javax.swing.JLabel();
        prinE2 = new javax.swing.JLabel();
        prinF2 = new javax.swing.JLabel();
        prinG2 = new javax.swing.JLabel();
        prinH2 = new javax.swing.JLabel();
        prinA8 = new javax.swing.JLabel();
        prinB8 = new javax.swing.JLabel();
        prinC8 = new javax.swing.JLabel();
        prinD8 = new javax.swing.JLabel();
        prinE8 = new javax.swing.JLabel();
        prinF8 = new javax.swing.JLabel();
        prinG8 = new javax.swing.JLabel();
        prinH8 = new javax.swing.JLabel();
        prinA7 = new javax.swing.JLabel();
        prinB7 = new javax.swing.JLabel();
        prinC7 = new javax.swing.JLabel();
        prinD7 = new javax.swing.JLabel();
        prinE7 = new javax.swing.JLabel();
        prinF7 = new javax.swing.JLabel();
        prinG7 = new javax.swing.JLabel();
        prinH7 = new javax.swing.JLabel();
        prinA6 = new javax.swing.JLabel();
        prinB6 = new javax.swing.JLabel();
        prinC6 = new javax.swing.JLabel();
        prinD6 = new javax.swing.JLabel();
        prinE5 = new javax.swing.JLabel();
        prinE6 = new javax.swing.JLabel();
        prinF6 = new javax.swing.JLabel();
        prinF5 = new javax.swing.JLabel();
        prinG5 = new javax.swing.JLabel();
        prinG6 = new javax.swing.JLabel();
        prinH6 = new javax.swing.JLabel();
        prinH5 = new javax.swing.JLabel();
        prinA4 = new javax.swing.JLabel();
        prinA5 = new javax.swing.JLabel();
        prinB5 = new javax.swing.JLabel();
        prinB4 = new javax.swing.JLabel();
        prinC4 = new javax.swing.JLabel();
        prinC5 = new javax.swing.JLabel();
        prinD5 = new javax.swing.JLabel();
        prinD4 = new javax.swing.JLabel();
        prinE4 = new javax.swing.JLabel();
        prinF4 = new javax.swing.JLabel();
        prinG4 = new javax.swing.JLabel();
        prinH4 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        jLabel31 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        jLabel49 = new javax.swing.JLabel();
        jLabel52 = new javax.swing.JLabel();
        jLabel53 = new javax.swing.JLabel();
        jLabel56 = new javax.swing.JLabel();
        jLabel74 = new javax.swing.JLabel();
        jLabel75 = new javax.swing.JLabel();
        jLabel78 = new javax.swing.JLabel();
        jLabel79 = new javax.swing.JLabel();
        lbl2NomeJogador1 = new javax.swing.JLabel();
        lbl2NomeJogador2 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        btnDesistir = new javax.swing.JButton();
        btnEmpate = new javax.swing.JButton();
        btnSair = new javax.swing.JButton();
        jLabel4 = new javax.swing.JLabel();
        jPanel12 = new javax.swing.JPanel();
        lblNomeJogador4 = new javax.swing.JLabel();
        lblNomeJogador3 = new javax.swing.JLabel();
        lblTempoJogador3 = new javax.swing.JLabel();
        lblEhTurnoJogador3 = new javax.swing.JLabel();
        lblTempoJogador2 = new javax.swing.JLabel();
        lblEhTurnoJogador4 = new javax.swing.JLabel();
        repJogador2 = new javax.swing.JPanel();
        jLabel24 = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        torreJogador2 = new javax.swing.JLabel();
        jLabel36 = new javax.swing.JLabel();
        peaoJogador2 = new javax.swing.JLabel();
        bispoJogador2 = new javax.swing.JLabel();
        jLabel39 = new javax.swing.JLabel();
        cavaloJogador2 = new javax.swing.JLabel();
        jLabel41 = new javax.swing.JLabel();
        damaJogador2 = new javax.swing.JLabel();
        repJogador1 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        torreJogador1 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        peaoJogador1 = new javax.swing.JLabel();
        bispoJogador1 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        cavaloJogador1 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        damaJogador1 = new javax.swing.JLabel();
        repJogador3 = new javax.swing.JPanel();
        jLabel35 = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        jLabel38 = new javax.swing.JLabel();
        torreJogador3 = new javax.swing.JLabel();
        jLabel40 = new javax.swing.JLabel();
        peaoJogador3 = new javax.swing.JLabel();
        bispoJogador3 = new javax.swing.JLabel();
        jLabel42 = new javax.swing.JLabel();
        cavaloJogador3 = new javax.swing.JLabel();
        jLabel43 = new javax.swing.JLabel();
        damaJogador3 = new javax.swing.JLabel();

        getContentPane().setLayout(null);

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("MagChess 1.0 Jogo");
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setResizable(false);
        jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Tabuleiro secund\u00e1rio"));
        secA1.setBackground(new java.awt.Color(0, 0, 0));
        secA1.setOpaque(true);
        jPanel2.add(secA1, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 290, 34, 34));

        secB1.setBackground(new java.awt.Color(255, 255, 255));
        secB1.setOpaque(true);
        jPanel2.add(secB1, new org.netbeans.lib.awtextra.AbsoluteConstraints(64, 290, 34, 34));

        secC1.setBackground(new java.awt.Color(0, 0, 0));
        secC1.setOpaque(true);
        jPanel2.add(secC1, new org.netbeans.lib.awtextra.AbsoluteConstraints(98, 290, 34, 34));

        secD1.setBackground(new java.awt.Color(255, 255, 255));
        secD1.setOpaque(true);
        jPanel2.add(secD1, new org.netbeans.lib.awtextra.AbsoluteConstraints(132, 290, 34, 34));

        secE1.setBackground(new java.awt.Color(0, 0, 0));
        secE1.setOpaque(true);
        jPanel2.add(secE1, new org.netbeans.lib.awtextra.AbsoluteConstraints(166, 290, 34, 34));

        secF1.setBackground(new java.awt.Color(255, 255, 255));
        secF1.setOpaque(true);
        jPanel2.add(secF1, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 290, 34, 34));

        secG1.setBackground(new java.awt.Color(0, 0, 0));
        secG1.setOpaque(true);
        jPanel2.add(secG1, new org.netbeans.lib.awtextra.AbsoluteConstraints(234, 290, 34, 34));

        secH1.setBackground(new java.awt.Color(255, 255, 255));
        secH1.setOpaque(true);
        jPanel2.add(secH1, new org.netbeans.lib.awtextra.AbsoluteConstraints(268, 290, 34, 34));

        secG2.setBackground(new java.awt.Color(255, 255, 255));
        secG2.setOpaque(true);
        jPanel2.add(secG2, new org.netbeans.lib.awtextra.AbsoluteConstraints(234, 256, 34, 34));

        secF2.setBackground(new java.awt.Color(0, 0, 0));
        secF2.setOpaque(true);
        jPanel2.add(secF2, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 256, 34, 34));

        secE2.setBackground(new java.awt.Color(255, 255, 255));
        secE2.setOpaque(true);
        jPanel2.add(secE2, new org.netbeans.lib.awtextra.AbsoluteConstraints(166, 256, 34, 34));

        secD2.setBackground(new java.awt.Color(0, 0, 0));
        secD2.setOpaque(true);
        jPanel2.add(secD2, new org.netbeans.lib.awtextra.AbsoluteConstraints(132, 256, 34, 34));

        secC2.setBackground(new java.awt.Color(255, 255, 255));
        secC2.setOpaque(true);
        jPanel2.add(secC2, new org.netbeans.lib.awtextra.AbsoluteConstraints(98, 256, 34, 34));

        secB2.setBackground(new java.awt.Color(0, 0, 0));
        secB2.setOpaque(true);
        jPanel2.add(secB2, new org.netbeans.lib.awtextra.AbsoluteConstraints(64, 256, 34, 34));

        secA2.setBackground(new java.awt.Color(255, 255, 255));
        secA2.setOpaque(true);
        jPanel2.add(secA2, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 256, 34, 34));

        secH2.setBackground(new java.awt.Color(0, 0, 0));
        secH2.setOpaque(true);
        jPanel2.add(secH2, new org.netbeans.lib.awtextra.AbsoluteConstraints(268, 256, 34, 34));

        secA3.setBackground(new java.awt.Color(0, 0, 0));
        secA3.setOpaque(true);
        jPanel2.add(secA3, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 222, 34, 34));

        secA4.setBackground(new java.awt.Color(255, 255, 255));
        secA4.setOpaque(true);
        jPanel2.add(secA4, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 188, 34, 34));

        secB4.setBackground(new java.awt.Color(0, 0, 0));
        secB4.setOpaque(true);
        jPanel2.add(secB4, new org.netbeans.lib.awtextra.AbsoluteConstraints(64, 188, 34, 34));

        secB3.setBackground(new java.awt.Color(255, 255, 255));
        secB3.setOpaque(true);
        jPanel2.add(secB3, new org.netbeans.lib.awtextra.AbsoluteConstraints(64, 222, 34, 34));

        secC3.setBackground(new java.awt.Color(0, 0, 0));
        secC3.setOpaque(true);
        jPanel2.add(secC3, new org.netbeans.lib.awtextra.AbsoluteConstraints(98, 222, 34, 34));

        secC4.setBackground(new java.awt.Color(255, 255, 255));
        secC4.setOpaque(true);
        jPanel2.add(secC4, new org.netbeans.lib.awtextra.AbsoluteConstraints(98, 188, 34, 34));

        secD4.setBackground(new java.awt.Color(0, 0, 0));
        secD4.setOpaque(true);
        jPanel2.add(secD4, new org.netbeans.lib.awtextra.AbsoluteConstraints(132, 188, 34, 34));

        secD3.setBackground(new java.awt.Color(255, 255, 255));
        secD3.setOpaque(true);
        jPanel2.add(secD3, new org.netbeans.lib.awtextra.AbsoluteConstraints(132, 222, 34, 34));

        secE4.setBackground(new java.awt.Color(255, 255, 255));
        secE4.setOpaque(true);
        jPanel2.add(secE4, new org.netbeans.lib.awtextra.AbsoluteConstraints(166, 188, 34, 34));

        secE3.setBackground(new java.awt.Color(0, 0, 0));
        secE3.setOpaque(true);
        jPanel2.add(secE3, new org.netbeans.lib.awtextra.AbsoluteConstraints(166, 222, 34, 34));

        secF4.setBackground(new java.awt.Color(0, 0, 0));
        secF4.setOpaque(true);
        jPanel2.add(secF4, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 188, 34, 34));

        secF3.setBackground(new java.awt.Color(255, 255, 255));
        secF3.setOpaque(true);
        jPanel2.add(secF3, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 222, 34, 34));

        secG4.setBackground(new java.awt.Color(255, 255, 255));
        secG4.setOpaque(true);
        jPanel2.add(secG4, new org.netbeans.lib.awtextra.AbsoluteConstraints(234, 188, 34, 34));

        secG3.setBackground(new java.awt.Color(0, 0, 0));
        secG3.setOpaque(true);
        jPanel2.add(secG3, new org.netbeans.lib.awtextra.AbsoluteConstraints(234, 222, 34, 34));

        secH3.setBackground(new java.awt.Color(255, 255, 255));
        secH3.setOpaque(true);
        jPanel2.add(secH3, new org.netbeans.lib.awtextra.AbsoluteConstraints(268, 222, 34, 34));

        secH4.setBackground(new java.awt.Color(0, 0, 0));
        secH4.setOpaque(true);
        jPanel2.add(secH4, new org.netbeans.lib.awtextra.AbsoluteConstraints(268, 188, 34, 34));

        secA5.setBackground(new java.awt.Color(0, 0, 0));
        secA5.setOpaque(true);
        jPanel2.add(secA5, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 154, 34, 34));

        secA6.setBackground(new java.awt.Color(255, 255, 255));
        secA6.setOpaque(true);
        jPanel2.add(secA6, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 120, 34, 34));

        secB6.setBackground(new java.awt.Color(0, 0, 0));
        secB6.setOpaque(true);
        jPanel2.add(secB6, new org.netbeans.lib.awtextra.AbsoluteConstraints(64, 120, 34, 34));

        secB5.setBackground(new java.awt.Color(255, 255, 255));
        secB5.setOpaque(true);
        jPanel2.add(secB5, new org.netbeans.lib.awtextra.AbsoluteConstraints(64, 154, 34, 34));

        secC5.setBackground(new java.awt.Color(0, 0, 0));
        secC5.setOpaque(true);
        jPanel2.add(secC5, new org.netbeans.lib.awtextra.AbsoluteConstraints(98, 154, 34, 34));

        secC6.setBackground(new java.awt.Color(255, 255, 255));
        secC6.setOpaque(true);
        jPanel2.add(secC6, new org.netbeans.lib.awtextra.AbsoluteConstraints(98, 120, 34, 34));

        secD6.setBackground(new java.awt.Color(0, 0, 0));
        secD6.setOpaque(true);
        jPanel2.add(secD6, new org.netbeans.lib.awtextra.AbsoluteConstraints(132, 120, 34, 34));

        secD5.setBackground(new java.awt.Color(255, 255, 255));
        secD5.setOpaque(true);
        jPanel2.add(secD5, new org.netbeans.lib.awtextra.AbsoluteConstraints(132, 154, 34, 34));

        secE6.setBackground(new java.awt.Color(255, 255, 255));
        secE6.setOpaque(true);
        jPanel2.add(secE6, new org.netbeans.lib.awtextra.AbsoluteConstraints(166, 120, 34, 34));

        secE5.setBackground(new java.awt.Color(0, 0, 0));
        secE5.setOpaque(true);
        jPanel2.add(secE5, new org.netbeans.lib.awtextra.AbsoluteConstraints(166, 154, 34, 34));

        secF6.setBackground(new java.awt.Color(0, 0, 0));
        secF6.setOpaque(true);
        jPanel2.add(secF6, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 120, 34, 34));

        secF5.setBackground(new java.awt.Color(255, 255, 255));
        secF5.setOpaque(true);
        jPanel2.add(secF5, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 154, 34, 34));

        secG6.setBackground(new java.awt.Color(255, 255, 255));
        secG6.setOpaque(true);
        jPanel2.add(secG6, new org.netbeans.lib.awtextra.AbsoluteConstraints(234, 120, 34, 34));

        secG5.setBackground(new java.awt.Color(0, 0, 0));
        secG5.setOpaque(true);
        jPanel2.add(secG5, new org.netbeans.lib.awtextra.AbsoluteConstraints(234, 154, 34, 34));

        secH5.setBackground(new java.awt.Color(255, 255, 255));
        secH5.setOpaque(true);
        jPanel2.add(secH5, new org.netbeans.lib.awtextra.AbsoluteConstraints(268, 154, 34, 34));

        secH6.setBackground(new java.awt.Color(0, 0, 0));
        secH6.setOpaque(true);
        jPanel2.add(secH6, new org.netbeans.lib.awtextra.AbsoluteConstraints(268, 120, 34, 34));

        secA7.setBackground(new java.awt.Color(0, 0, 0));
        secA7.setOpaque(true);
        jPanel2.add(secA7, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 86, 34, 34));

        secA8.setBackground(new java.awt.Color(255, 255, 255));
        secA8.setOpaque(true);
        jPanel2.add(secA8, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 52, 34, 34));

        secB8.setBackground(new java.awt.Color(0, 0, 0));
        secB8.setOpaque(true);
        jPanel2.add(secB8, new org.netbeans.lib.awtextra.AbsoluteConstraints(64, 52, 34, 34));

        secB7.setBackground(new java.awt.Color(255, 255, 255));
        secB7.setOpaque(true);
        jPanel2.add(secB7, new org.netbeans.lib.awtextra.AbsoluteConstraints(64, 86, 34, 34));

        secC7.setBackground(new java.awt.Color(0, 0, 0));
        secC7.setOpaque(true);
        jPanel2.add(secC7, new org.netbeans.lib.awtextra.AbsoluteConstraints(98, 86, 34, 34));

        secC8.setBackground(new java.awt.Color(255, 255, 255));
        secC8.setOpaque(true);
        jPanel2.add(secC8, new org.netbeans.lib.awtextra.AbsoluteConstraints(98, 52, 34, 34));

        secD8.setBackground(new java.awt.Color(0, 0, 0));
        secD8.setOpaque(true);
        jPanel2.add(secD8, new org.netbeans.lib.awtextra.AbsoluteConstraints(132, 52, 34, 34));

        secD7.setBackground(new java.awt.Color(255, 255, 255));
        secD7.setOpaque(true);
        jPanel2.add(secD7, new org.netbeans.lib.awtextra.AbsoluteConstraints(132, 86, 34, 34));

        secE8.setBackground(new java.awt.Color(255, 255, 255));
        secE8.setOpaque(true);
        jPanel2.add(secE8, new org.netbeans.lib.awtextra.AbsoluteConstraints(166, 52, 34, 34));

        secE7.setBackground(new java.awt.Color(0, 0, 0));
        secE7.setOpaque(true);
        jPanel2.add(secE7, new org.netbeans.lib.awtextra.AbsoluteConstraints(166, 86, 34, 34));

        secF8.setBackground(new java.awt.Color(0, 0, 0));
        secF8.setOpaque(true);
        jPanel2.add(secF8, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 52, 34, 34));

        secF7.setBackground(new java.awt.Color(255, 255, 255));
        secF7.setOpaque(true);
        jPanel2.add(secF7, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 86, 34, 34));

        secG8.setBackground(new java.awt.Color(255, 255, 255));
        secG8.setOpaque(true);
        jPanel2.add(secG8, new org.netbeans.lib.awtextra.AbsoluteConstraints(234, 52, 34, 34));

        secG7.setBackground(new java.awt.Color(0, 0, 0));
        secG7.setOpaque(true);
        jPanel2.add(secG7, new org.netbeans.lib.awtextra.AbsoluteConstraints(234, 86, 34, 34));

        secH7.setBackground(new java.awt.Color(255, 255, 255));
        secH7.setOpaque(true);
        jPanel2.add(secH7, new org.netbeans.lib.awtextra.AbsoluteConstraints(268, 86, 34, 34));

        secH8.setBackground(new java.awt.Color(0, 0, 0));
        secH8.setOpaque(true);
        jPanel2.add(secH8, new org.netbeans.lib.awtextra.AbsoluteConstraints(268, 52, 34, 34));

        jLabel145.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel145.setText("A");
        jLabel145.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.add(jLabel145, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 326, 34, -1));

        jLabel146.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel146.setText("B");
        jLabel146.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.add(jLabel146, new org.netbeans.lib.awtextra.AbsoluteConstraints(64, 326, 34, -1));

        jLabel147.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel147.setText("C");
        jLabel147.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.add(jLabel147, new org.netbeans.lib.awtextra.AbsoluteConstraints(98, 326, 34, -1));

        jLabel148.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel148.setText("D");
        jLabel148.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.add(jLabel148, new org.netbeans.lib.awtextra.AbsoluteConstraints(132, 326, 34, -1));

        jLabel149.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel149.setText("E");
        jLabel149.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.add(jLabel149, new org.netbeans.lib.awtextra.AbsoluteConstraints(166, 326, 34, -1));

        jLabel150.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel150.setText("F");
        jLabel150.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.add(jLabel150, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 326, 34, -1));

        jLabel151.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel151.setText("G");
        jLabel151.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.add(jLabel151, new org.netbeans.lib.awtextra.AbsoluteConstraints(234, 326, 34, -1));

        jLabel152.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel152.setText("H");
        jLabel152.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.add(jLabel152, new org.netbeans.lib.awtextra.AbsoluteConstraints(268, 326, 34, -1));

        jLabel169.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel169.setText("1");
        jLabel169.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.add(jLabel169, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 290, 20, 34));

        jLabel170.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel170.setText("2");
        jLabel170.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.add(jLabel170, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 256, 20, 34));

        jLabel171.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel171.setText("3");
        jLabel171.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.add(jLabel171, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 222, 20, 34));

        jLabel172.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel172.setText("4");
        jLabel172.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.add(jLabel172, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 186, 20, 34));

        jLabel173.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel173.setText("5");
        jLabel173.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.add(jLabel173, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 152, 20, 34));

        jLabel174.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel174.setText("6");
        jLabel174.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.add(jLabel174, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 118, 20, 34));

        jLabel175.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel175.setText("7");
        jLabel175.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.add(jLabel175, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 84, 20, 34));

        jLabel176.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel176.setText("8");
        jLabel176.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.add(jLabel176, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 50, 20, 34));

        jLabel155.setFont(new java.awt.Font("MS Sans Serif", 1, 14));
        jLabel155.setText("Maguila");
        jPanel2.add(jLabel155, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 450, -1, -1));

        lbl2NomeJogador3.setFont(new java.awt.Font("MS Sans Serif", 1, 14));
        lbl2NomeJogador3.setText("Victor");
        jPanel2.add(lbl2NomeJogador3, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 350, -1, -1));

        lbl2NomeJogador4.setFont(new java.awt.Font("MS Sans Serif", 1, 14));
        lbl2NomeJogador4.setText("Victor");
        jPanel2.add(lbl2NomeJogador4, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 30, -1, -1));

        getContentPane().add(jPanel2);
        jPanel2.setBounds(10, 0, 340, 380);

        jPanel4.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Reposit\u00f3rio dupla advers\u00e1ria"));
        getContentPane().add(jPanel4);
        jPanel4.setBounds(10, 480, 170, 0);

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("Bate papo"));

        btnEnviarMsg.setText("Enviar mensagem");
        btnEnviarMsg.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEnviarMsgActionPerformed(evt);
            }
        });

        lblTextoBP.setBackground(new java.awt.Color(255, 255, 255));
        lblTextoBP.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        lblTextoBP.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        lblTextoBP.setOpaque(true);

        org.jdesktop.layout.GroupLayout jPanel6Layout = new org.jdesktop.layout.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel6Layout.createSequentialGroup()
                .addContainerGap(58, Short.MAX_VALUE)
                .add(jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel6Layout.createSequentialGroup()
                        .add(lblMsgBP)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(btnEnviarMsg))
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, lblTextoBP, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 450, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel6Layout.createSequentialGroup()
                .add(lblTextoBP, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 64, Short.MAX_VALUE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(btnEnviarMsg)
                    .add(lblMsgBP, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
        );
        getContentPane().add(jPanel6);
        jPanel6.setBounds(380, 490, 520, 120);

        repJogador0.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        repJogador0.setBorder(javax.swing.BorderFactory.createTitledBorder("Reposit\u00f3rio jogador"));
        repJogador0.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                repJogador0MouseClicked(evt);
            }
        });

        jLabel1.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Peao\\PB_Bgr.JPG"));
        repJogador0.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 20, -1, -1));

        jLabel2.setText(" ");
        repJogador0.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 40, -1, -1));

        jLabel6.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Torres\\TB_Bgr.JPG"));
        repJogador0.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 20, -1, -1));

        torreJogador0.setFont(new java.awt.Font("MS Sans Serif", 1, 18));
        torreJogador0.setText("0");
        repJogador0.add(torreJogador0, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 80, 10, -1));

        jLabel8.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Damas\\DB_bgr.JPG"));
        repJogador0.add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 20, -1, -1));

        peaoJogador0.setFont(new java.awt.Font("MS Sans Serif", 1, 18));
        peaoJogador0.setText("0");
        repJogador0.add(peaoJogador0, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 80, 10, -1));

        bispoJogador0.setFont(new java.awt.Font("MS Sans Serif", 1, 18));
        bispoJogador0.setText("0");
        repJogador0.add(bispoJogador0, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 80, -1, -1));

        jLabel3.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Cavalos\\CB_Bgr.JPG"));
        repJogador0.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 20, -1, -1));

        cavaloJogador0.setFont(new java.awt.Font("MS Sans Serif", 1, 18));
        cavaloJogador0.setText("0");
        repJogador0.add(cavaloJogador0, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 80, -1, -1));

        jLabel12.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Bispos\\BB_Bgr.JPG"));
        repJogador0.add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 20, -1, -1));

        damaJogador0.setFont(new java.awt.Font("MS Sans Serif", 1, 18));
        damaJogador0.setText("0");
        repJogador0.add(damaJogador0, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 80, 10, -1));

        getContentPane().add(repJogador0);
        repJogador0.setBounds(910, 490, 290, 120);

        jPanel9.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder("Partida principal"));
        lblNomeJogador2.setFont(new java.awt.Font("MS Sans Serif", 0, 18));
        lblNomeJogador2.setForeground(new java.awt.Color(255, 0, 0));
        lblNomeJogador2.setText("Maguila");
        jPanel9.add(lblNomeJogador2, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 20, -1, -1));

        lblNomeJogador1.setFont(new java.awt.Font("MS Sans Serif", 0, 18));
        lblNomeJogador1.setText("Victor");
        jPanel9.add(lblNomeJogador1, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 70, -1, 20));

        lblTempoJogador0.setFont(new java.awt.Font("MS Sans Serif", 0, 18));
        lblTempoJogador0.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        lblTempoJogador0.setText("15:00");
        lblTempoJogador0.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel9.add(lblTempoJogador0, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 70, 70, 20));

        lblEhTurnoJogador1.setFont(new java.awt.Font("MS Sans Serif", 0, 18));
        lblEhTurnoJogador1.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Peao\\PB_Bpeq.JPG"));
        jPanel9.add(lblEhTurnoJogador1, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 60, -1, -1));

        lblTempoJogador1.setFont(new java.awt.Font("MS Sans Serif", 0, 18));
        lblTempoJogador1.setForeground(new java.awt.Color(255, 0, 51));
        lblTempoJogador1.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        lblTempoJogador1.setText("15:00");
        lblTempoJogador1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel9.add(lblTempoJogador1, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 20, 70, 20));

        lblEhTurnoJogador2.setFont(new java.awt.Font("MS Sans Serif", 0, 18));
        lblEhTurnoJogador2.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Peao\\PB_Bpeq.JPG"));
        jPanel9.add(lblEhTurnoJogador2, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 10, -1, 40));

        getContentPane().add(jPanel9);
        jPanel9.setBounds(910, 390, 290, 100);

        jPanel10.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder("Tabuleiro principal"));
        jPanel10.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jPanel10MouseClicked(evt);
            }
        });

        prinG1.setBackground(new java.awt.Color(51, 51, 51));
        prinG1.setOpaque(true);
        jPanel10.add(prinG1, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 380, 48, 48));

        prinF1.setBackground(new java.awt.Color(255, 255, 255));
        prinF1.setOpaque(true);
        jPanel10.add(prinF1, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 380, 48, 48));

        prinE1.setBackground(new java.awt.Color(51, 51, 51));
        prinE1.setOpaque(true);
        jPanel10.add(prinE1, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 380, 48, 48));

        prinD1.setBackground(new java.awt.Color(255, 255, 255));
        prinD1.setOpaque(true);
        jPanel10.add(prinD1, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 380, 48, 48));

        prinH1.setBackground(new java.awt.Color(255, 255, 255));
        prinH1.setOpaque(true);
        jPanel10.add(prinH1, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 380, 48, 48));

        prinC1.setBackground(new java.awt.Color(51, 51, 51));
        prinC1.setOpaque(true);
        jPanel10.add(prinC1, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 380, 48, 48));

        prinB1.setBackground(new java.awt.Color(255, 255, 255));
        prinB1.setOpaque(true);
        jPanel10.add(prinB1, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 380, 48, 48));

        prinA1.setBackground(new java.awt.Color(51, 51, 51));
        prinA1.setOpaque(true);
        jPanel10.add(prinA1, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 380, 48, 48));

        prinA3.setBackground(new java.awt.Color(51, 51, 51));
        prinA3.setOpaque(true);
        jPanel10.add(prinA3, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 280, 48, 48));

        prinB3.setBackground(new java.awt.Color(255, 255, 255));
        prinB3.setOpaque(true);
        jPanel10.add(prinB3, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 280, 48, 48));

        prinC3.setBackground(new java.awt.Color(51, 51, 51));
        prinC3.setOpaque(true);
        jPanel10.add(prinC3, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 280, 48, 48));

        prinD3.setBackground(new java.awt.Color(255, 255, 255));
        prinD3.setOpaque(true);
        jPanel10.add(prinD3, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 280, 48, 48));

        prinE3.setBackground(new java.awt.Color(51, 51, 51));
        prinE3.setOpaque(true);
        jPanel10.add(prinE3, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 280, 48, 48));

        prinF3.setBackground(new java.awt.Color(255, 255, 255));
        prinF3.setOpaque(true);
        jPanel10.add(prinF3, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 280, 48, 48));

        prinG3.setBackground(new java.awt.Color(51, 51, 51));
        prinG3.setOpaque(true);
        jPanel10.add(prinG3, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 280, 48, 48));

        prinH3.setBackground(new java.awt.Color(255, 255, 255));
        prinH3.setOpaque(true);
        jPanel10.add(prinH3, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 280, 48, 48));

        prinA2.setBackground(new java.awt.Color(255, 255, 255));
        prinA2.setOpaque(true);
        jPanel10.add(prinA2, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 330, 48, 48));

        prinB2.setBackground(new java.awt.Color(51, 51, 51));
        prinB2.setOpaque(true);
        jPanel10.add(prinB2, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 330, 48, 48));

        prinC2.setBackground(new java.awt.Color(255, 255, 255));
        prinC2.setOpaque(true);
        jPanel10.add(prinC2, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 330, 48, 48));

        prinD2.setBackground(new java.awt.Color(51, 51, 51));
        prinD2.setOpaque(true);
        jPanel10.add(prinD2, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 330, 48, 48));

        prinE2.setBackground(new java.awt.Color(255, 255, 255));
        prinE2.setOpaque(true);
        jPanel10.add(prinE2, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 330, 48, 48));

        prinF2.setBackground(new java.awt.Color(51, 51, 51));
        prinF2.setOpaque(true);
        jPanel10.add(prinF2, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 330, 48, 48));

        prinG2.setBackground(new java.awt.Color(255, 255, 255));
        prinG2.setOpaque(true);
        jPanel10.add(prinG2, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 330, 48, 48));

        prinH2.setBackground(new java.awt.Color(51, 51, 51));
        prinH2.setOpaque(true);
        jPanel10.add(prinH2, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 330, 48, 48));

        prinA8.setBackground(new java.awt.Color(255, 255, 255));
        prinA8.setOpaque(true);
        jPanel10.add(prinA8, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 30, 48, 48));

        prinB8.setBackground(new java.awt.Color(51, 51, 51));
        prinB8.setOpaque(true);
        jPanel10.add(prinB8, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 30, 48, 48));

        prinC8.setBackground(new java.awt.Color(255, 255, 255));
        prinC8.setOpaque(true);
        jPanel10.add(prinC8, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 30, 48, 48));

        prinD8.setBackground(new java.awt.Color(51, 51, 51));
        prinD8.setOpaque(true);
        jPanel10.add(prinD8, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 30, 48, 48));

        prinE8.setBackground(new java.awt.Color(255, 255, 255));
        prinE8.setOpaque(true);
        jPanel10.add(prinE8, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 30, 48, 48));

        prinF8.setBackground(new java.awt.Color(51, 51, 51));
        prinF8.setOpaque(true);
        jPanel10.add(prinF8, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 30, 48, 48));

        prinG8.setBackground(new java.awt.Color(255, 255, 255));
        prinG8.setOpaque(true);
        jPanel10.add(prinG8, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 30, 48, 48));

        prinH8.setBackground(new java.awt.Color(51, 51, 51));
        prinH8.setOpaque(true);
        jPanel10.add(prinH8, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 30, 48, 48));

        prinA7.setBackground(new java.awt.Color(51, 51, 51));
        prinA7.setOpaque(true);
        jPanel10.add(prinA7, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 80, 48, 48));

        prinB7.setBackground(new java.awt.Color(255, 255, 255));
        prinB7.setOpaque(true);
        jPanel10.add(prinB7, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 80, 48, 48));

        prinC7.setBackground(new java.awt.Color(51, 51, 51));
        prinC7.setOpaque(true);
        jPanel10.add(prinC7, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 80, 48, 48));

        prinD7.setBackground(new java.awt.Color(255, 255, 255));
        prinD7.setOpaque(true);
        jPanel10.add(prinD7, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 80, 48, 48));

        prinE7.setBackground(new java.awt.Color(51, 51, 51));
        prinE7.setOpaque(true);
        jPanel10.add(prinE7, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 80, 48, 48));

        prinF7.setBackground(new java.awt.Color(255, 255, 255));
        prinF7.setOpaque(true);
        jPanel10.add(prinF7, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 80, 48, 48));

        prinG7.setBackground(new java.awt.Color(51, 51, 51));
        prinG7.setOpaque(true);
        jPanel10.add(prinG7, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 80, 48, 48));

        prinH7.setBackground(new java.awt.Color(255, 255, 255));
        prinH7.setOpaque(true);
        jPanel10.add(prinH7, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 80, 48, 48));

        prinA6.setBackground(new java.awt.Color(255, 255, 255));
        prinA6.setOpaque(true);
        jPanel10.add(prinA6, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 130, 48, 48));

        prinB6.setBackground(new java.awt.Color(51, 51, 51));
        prinB6.setOpaque(true);
        jPanel10.add(prinB6, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 130, 48, 48));

        prinC6.setBackground(new java.awt.Color(255, 255, 255));
        prinC6.setOpaque(true);
        jPanel10.add(prinC6, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 130, 48, 48));

        prinD6.setBackground(new java.awt.Color(51, 51, 51));
        prinD6.setOpaque(true);
        jPanel10.add(prinD6, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 130, 48, 48));

        prinE5.setBackground(new java.awt.Color(51, 51, 51));
        prinE5.setOpaque(true);
        jPanel10.add(prinE5, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 180, 48, 48));

        prinE6.setBackground(new java.awt.Color(255, 255, 255));
        prinE6.setOpaque(true);
        jPanel10.add(prinE6, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 130, 48, 48));

        prinF6.setBackground(new java.awt.Color(51, 51, 51));
        prinF6.setOpaque(true);
        jPanel10.add(prinF6, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 130, 48, 48));

        prinF5.setBackground(new java.awt.Color(255, 255, 255));
        prinF5.setOpaque(true);
        jPanel10.add(prinF5, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 180, 48, 48));

        prinG5.setBackground(new java.awt.Color(51, 51, 51));
        prinG5.setOpaque(true);
        jPanel10.add(prinG5, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 180, 48, 48));

        prinG6.setBackground(new java.awt.Color(255, 255, 255));
        prinG6.setOpaque(true);
        jPanel10.add(prinG6, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 130, 48, 48));

        prinH6.setBackground(new java.awt.Color(51, 51, 51));
        prinH6.setOpaque(true);
        jPanel10.add(prinH6, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 130, 48, 48));

        prinH5.setBackground(new java.awt.Color(255, 255, 255));
        prinH5.setOpaque(true);
        jPanel10.add(prinH5, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 180, 48, 48));

        prinA4.setBackground(new java.awt.Color(255, 255, 255));
        prinA4.setOpaque(true);
        jPanel10.add(prinA4, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 230, 48, 48));

        prinA5.setBackground(new java.awt.Color(51, 51, 51));
        prinA5.setOpaque(true);
        jPanel10.add(prinA5, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 180, 48, 48));

        prinB5.setBackground(new java.awt.Color(255, 255, 255));
        prinB5.setOpaque(true);
        jPanel10.add(prinB5, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 180, 48, 48));

        prinB4.setBackground(new java.awt.Color(51, 51, 51));
        prinB4.setOpaque(true);
        jPanel10.add(prinB4, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 230, 48, 48));

        prinC4.setBackground(new java.awt.Color(255, 255, 255));
        prinC4.setOpaque(true);
        jPanel10.add(prinC4, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 230, 48, 48));

        prinC5.setBackground(new java.awt.Color(51, 51, 51));
        prinC5.setOpaque(true);
        jPanel10.add(prinC5, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 180, 48, 48));

        prinD5.setBackground(new java.awt.Color(255, 255, 255));
        prinD5.setOpaque(true);
        jPanel10.add(prinD5, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 180, 48, 48));

        prinD4.setBackground(new java.awt.Color(51, 51, 51));
        prinD4.setOpaque(true);
        jPanel10.add(prinD4, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 230, 48, 48));

        prinE4.setBackground(new java.awt.Color(255, 255, 255));
        prinE4.setOpaque(true);
        jPanel10.add(prinE4, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 230, 48, 48));

        prinF4.setBackground(new java.awt.Color(51, 51, 51));
        prinF4.setOpaque(true);
        jPanel10.add(prinF4, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 230, 48, 48));

        prinG4.setBackground(new java.awt.Color(255, 255, 255));
        prinG4.setOpaque(true);
        jPanel10.add(prinG4, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 230, 48, 48));

        prinH4.setBackground(new java.awt.Color(51, 51, 51));
        prinH4.setOpaque(true);
        jPanel10.add(prinH4, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 230, 48, 48));

        jLabel25.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel25.setText("A");
        jLabel25.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel10.add(jLabel25, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 430, 50, 20));

        jLabel26.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel26.setText("B");
        jLabel26.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel10.add(jLabel26, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 430, 50, 20));

        jLabel27.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel27.setText("C");
        jLabel27.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel10.add(jLabel27, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 430, 50, 20));

        jLabel28.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel28.setText("D");
        jLabel28.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel10.add(jLabel28, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 430, 50, 20));

        jLabel29.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel29.setText("E");
        jLabel29.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel10.add(jLabel29, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 430, 50, 20));

        jLabel30.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel30.setText("F");
        jLabel30.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel10.add(jLabel30, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 430, 50, 20));

        jLabel31.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel31.setText("G");
        jLabel31.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel10.add(jLabel31, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 430, 50, 20));

        jLabel32.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel32.setText("H");
        jLabel32.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel10.add(jLabel32, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 430, 50, 20));

        jLabel49.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel49.setText("1");
        jLabel49.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel10.add(jLabel49, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 380, 20, 50));

        jLabel52.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel52.setText("2");
        jLabel52.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel10.add(jLabel52, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 330, 20, 50));

        jLabel53.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel53.setText("3");
        jLabel53.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel10.add(jLabel53, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 280, 20, 50));

        jLabel56.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel56.setText("4");
        jLabel56.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel10.add(jLabel56, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 230, 20, 50));

        jLabel74.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel74.setText("5");
        jLabel74.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel10.add(jLabel74, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 180, 20, 50));

        jLabel75.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel75.setText("6");
        jLabel75.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel10.add(jLabel75, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 130, 20, 50));

        jLabel78.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel78.setText("7");
        jLabel78.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel10.add(jLabel78, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 80, 20, 50));

        jLabel79.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel79.setText("8");
        jLabel79.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel10.add(jLabel79, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 30, 20, 50));

        lbl2NomeJogador1.setFont(new java.awt.Font("MS Sans Serif", 1, 14));
        lbl2NomeJogador1.setText("Maguila");
        jPanel10.add(lbl2NomeJogador1, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 450, -1, -1));

        lbl2NomeJogador2.setFont(new java.awt.Font("MS Sans Serif", 1, 14));
        lbl2NomeJogador2.setText("Maguila");
        jPanel10.add(lbl2NomeJogador2, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 10, -1, -1));

        getContentPane().add(jPanel10);
        jPanel10.setBounds(380, 10, 520, 480);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Op\u00e7\u00f5es de jogo"));
        btnDesistir.setText("Desisitir");

        btnEmpate.setText("Oferecer empate");

        btnSair.setText("Sair");

        org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .add(btnDesistir)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(btnEmpate)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(btnSair, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                .add(btnDesistir)
                .add(btnEmpate)
                .add(btnSair))
        );
        getContentPane().add(jPanel1);
        jPanel1.setBounds(910, 220, 290, 50);

        jLabel4.setFont(new java.awt.Font("Arial", 1, 18));
        jLabel4.setText("MagChess 1.0 ");
        getContentPane().add(jLabel4);
        jLabel4.setBounds(910, 20, 150, 20);

        jPanel12.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jPanel12.setBorder(javax.swing.BorderFactory.createTitledBorder("Partida principal"));
        lblNomeJogador4.setFont(new java.awt.Font("MS Sans Serif", 0, 18));
        lblNomeJogador4.setForeground(new java.awt.Color(255, 0, 0));
        lblNomeJogador4.setText("Lima");
        jPanel12.add(lblNomeJogador4, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 20, -1, -1));

        lblNomeJogador3.setFont(new java.awt.Font("MS Sans Serif", 0, 18));
        lblNomeJogador3.setText("Dionisio");
        jPanel12.add(lblNomeJogador3, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 70, -1, 20));

        lblTempoJogador3.setFont(new java.awt.Font("MS Sans Serif", 0, 18));
        lblTempoJogador3.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        lblTempoJogador3.setText("15:00");
        lblTempoJogador3.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel12.add(lblTempoJogador3, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 70, 70, 20));

        lblEhTurnoJogador3.setFont(new java.awt.Font("MS Sans Serif", 0, 18));
        lblEhTurnoJogador3.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Peao\\PB_Bpeq.JPG"));
        jPanel12.add(lblEhTurnoJogador3, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 60, -1, -1));

        lblTempoJogador2.setFont(new java.awt.Font("MS Sans Serif", 0, 18));
        lblTempoJogador2.setForeground(new java.awt.Color(255, 0, 51));
        lblTempoJogador2.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        lblTempoJogador2.setText("15:00");
        lblTempoJogador2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel12.add(lblTempoJogador2, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 20, 70, 20));

        lblEhTurnoJogador4.setFont(new java.awt.Font("MS Sans Serif", 0, 18));
        lblEhTurnoJogador4.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Peao\\PB_Bpeq.JPG"));
        jPanel12.add(lblEhTurnoJogador4, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 10, -1, 40));

        getContentPane().add(jPanel12);
        jPanel12.setBounds(10, 380, 340, 100);

        repJogador2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        repJogador2.setBorder(javax.swing.BorderFactory.createTitledBorder("Reposit\u00f3rio jogador"));
        jLabel24.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Peao\\PB_Bextrapeq.JPG"));
        repJogador2.add(jLabel24, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 20, -1, -1));

        jLabel33.setText(" ");
        repJogador2.add(jLabel33, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 40, -1, -1));

        jLabel34.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Cavalos\\CB_Bextrapeq.JPG"));
        repJogador2.add(jLabel34, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 20, -1, -1));

        torreJogador2.setFont(new java.awt.Font("MS Sans Serif", 1, 18));
        torreJogador2.setText("0");
        repJogador2.add(torreJogador2, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 50, 10, -1));

        jLabel36.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Bispos\\BB_Bextrapeq.JPG"));
        repJogador2.add(jLabel36, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 20, -1, -1));

        peaoJogador2.setFont(new java.awt.Font("MS Sans Serif", 1, 18));
        peaoJogador2.setText("0");
        repJogador2.add(peaoJogador2, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 10, -1));

        bispoJogador2.setFont(new java.awt.Font("MS Sans Serif", 1, 18));
        bispoJogador2.setText("0");
        repJogador2.add(bispoJogador2, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 50, -1, -1));

        jLabel39.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Torres\\TB_Bextrapeq.JPG"));
        repJogador2.add(jLabel39, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 20, -1, -1));

        cavaloJogador2.setFont(new java.awt.Font("MS Sans Serif", 1, 18));
        cavaloJogador2.setText("0");
        repJogador2.add(cavaloJogador2, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 50, -1, -1));

        jLabel41.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Damas\\DB_bextrapeq.JPG"));
        repJogador2.add(jLabel41, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 20, -1, -1));

        damaJogador2.setFont(new java.awt.Font("MS Sans Serif", 1, 18));
        damaJogador2.setText("0");
        repJogador2.add(damaJogador2, new org.netbeans.lib.awtextra.AbsoluteConstraints(80, 50, 10, -1));

        getContentPane().add(repJogador2);
        repJogador2.setBounds(10, 490, 170, 80);

        repJogador1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        repJogador1.setBorder(javax.swing.BorderFactory.createTitledBorder("Reposit\u00f3rio jogador"));
        repJogador1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                repJogador1MouseClicked(evt);
            }
        });

        jLabel5.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Peao\\PB_Bgr.JPG"));
        repJogador1.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 20, -1, -1));

        jLabel7.setText(" ");
        repJogador1.add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 40, -1, -1));

        jLabel9.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Torres\\TB_Bgr.JPG"));
        repJogador1.add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 20, -1, -1));

        torreJogador1.setFont(new java.awt.Font("MS Sans Serif", 1, 18));
        torreJogador1.setText("0");
        repJogador1.add(torreJogador1, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 80, 10, -1));

        jLabel10.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Damas\\DB_bgr.JPG"));
        repJogador1.add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 20, -1, -1));

        peaoJogador1.setFont(new java.awt.Font("MS Sans Serif", 1, 18));
        peaoJogador1.setText("0");
        repJogador1.add(peaoJogador1, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 80, 10, -1));

        bispoJogador1.setFont(new java.awt.Font("MS Sans Serif", 1, 18));
        bispoJogador1.setText("0");
        repJogador1.add(bispoJogador1, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 80, -1, -1));

        jLabel11.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Cavalos\\CB_Bgr.JPG"));
        repJogador1.add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 20, -1, -1));

        cavaloJogador1.setFont(new java.awt.Font("MS Sans Serif", 1, 18));
        cavaloJogador1.setText("0");
        repJogador1.add(cavaloJogador1, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 80, -1, -1));

        jLabel13.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Bispos\\BB_Bgr.JPG"));
        repJogador1.add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 20, -1, -1));

        damaJogador1.setFont(new java.awt.Font("MS Sans Serif", 1, 18));
        damaJogador1.setText("0");
        repJogador1.add(damaJogador1, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 80, 10, -1));

        getContentPane().add(repJogador1);
        repJogador1.setBounds(910, 270, 290, 120);

        repJogador3.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        repJogador3.setBorder(javax.swing.BorderFactory.createTitledBorder("Reposit\u00f3rio jogador"));
        jLabel35.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Peao\\PB_Bextrapeq.JPG"));
        repJogador3.add(jLabel35, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 20, -1, -1));

        jLabel37.setText(" ");
        repJogador3.add(jLabel37, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 40, -1, -1));

        jLabel38.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Cavalos\\CB_Bextrapeq.JPG"));
        repJogador3.add(jLabel38, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 20, -1, -1));

        torreJogador3.setFont(new java.awt.Font("MS Sans Serif", 1, 18));
        torreJogador3.setText("0");
        repJogador3.add(torreJogador3, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 50, 10, -1));

        jLabel40.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Bispos\\BB_Bextrapeq.JPG"));
        repJogador3.add(jLabel40, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 20, -1, -1));

        peaoJogador3.setFont(new java.awt.Font("MS Sans Serif", 1, 18));
        peaoJogador3.setText("0");
        repJogador3.add(peaoJogador3, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 10, -1));

        bispoJogador3.setFont(new java.awt.Font("MS Sans Serif", 1, 18));
        bispoJogador3.setText("0");
        repJogador3.add(bispoJogador3, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 50, -1, -1));

        jLabel42.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Torres\\TB_Bextrapeq.JPG"));
        repJogador3.add(jLabel42, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 20, -1, -1));

        cavaloJogador3.setFont(new java.awt.Font("MS Sans Serif", 1, 18));
        cavaloJogador3.setText("0");
        repJogador3.add(cavaloJogador3, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 50, -1, -1));

        jLabel43.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\User\\Desktop\\Einstein\\figuras\\Damas\\DB_bextrapeq.JPG"));
        repJogador3.add(jLabel43, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 20, -1, -1));

        damaJogador3.setFont(new java.awt.Font("MS Sans Serif", 1, 18));
        damaJogador3.setText("0");
        repJogador3.add(damaJogador3, new org.netbeans.lib.awtextra.AbsoluteConstraints(80, 50, 10, -1));

        getContentPane().add(repJogador3);
        repJogador3.setBounds(180, 490, 170, 80);

        pack();
    }// </editor-fold>//GEN-END:initComponents
    
    private void btnEnviarMsgActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEnviarMsgActionPerformed
        c_controleJogo.atualizarBP(lblMsgBP.getText(),JOGADORPRINCIPAL);
        c_controleJogo.solicitaAtualizacaoBP(lblMsgBP.getText());
    }//GEN-LAST:event_btnEnviarMsgActionPerformed
    
    private void repJogador0MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_repJogador0MouseClicked
       
        
        int l_xRepositorio ;
        int l_yRepositorio ;
        
        if (evt.getY()<= 40 && evt.getY()>=20)
            if (evt.getX() >= 20 && evt.getX() <=240) {
            l_xRepositorio = (evt.getX()-20) /50 ;
            if (Integer.parseInt(c_repositoriosJogadores[JOGADORPRINCIPAL][l_xRepositorio].getText()) > 0 )
                c_controleJogo.tratarRepositorio(l_xRepositorio);
            }
    }//GEN-LAST:event_repJogador0MouseClicked
    
    
    
    
    public void atualizarTabuleiroPrincipal(boolean p_captura,Casa p_casaInicial, Casa p_casaFinal, String p_nomePeca , String p_corPeca, boolean p_repositorio) {
        if( p_captura)
            c_casasTabuleiroPrincipal[p_casaFinal.getLinha()][p_casaFinal.getColuna()].setIcon(null);
      c_casasTabuleiroPrincipal[p_casaFinal.getLinha()][p_casaFinal.getColuna()].setIcon(new javax.swing.ImageIcon(getClass().getResource(montaStringPrincipal(p_casaInicial,p_casaFinal, p_nomePeca, p_corPeca))));
      if (!p_repositorio)
      c_casasTabuleiroPrincipal[p_casaInicial.getLinha()][p_casaInicial.getColuna()].setIcon(null);
      
      
      
    }
    
    
    public void atualizarTabuleiroSecundario(boolean p_captura,Casa p_casaInicial, Casa p_casaFinal, String p_nomePeca , String p_corPeca,boolean p_repositorio) {
        if( p_captura)
            c_casasTabuleiroSecundario[p_casaInicial.getLinha()][p_casaFinal.getColuna()].setIcon(null);
        c_casasTabuleiroSecundario[p_casaInicial.getLinha()][p_casaInicial.getColuna()].setIcon(null);
         c_casasTabuleiroSecundario[p_casaFinal.getLinha()][p_casaFinal.getColuna()].setIcon(new javax.swing.ImageIcon(getClass().getResource(montaStringSecundario(p_casaInicial,p_casaFinal, p_nomePeca, p_corPeca))));
      if (!p_repositorio)
      c_casasTabuleiroSecundario[p_casaInicial.getLinha()][p_casaInicial.getColuna()].setIcon(null);
    }
    
    
    
    public void incrementarRepositorioAlvo(int p_numeroRepositorio, int p_indicePeca) {
        
    }
    
    public void decrementarRepositorioAlvo(int p_numeroRepositorio, int p_indicePeca) {
        
    }
    
    private boolean verificaCasasMesmaCor(Casa p_casaInicial, Casa p_casaFinal) {
        int l_paridadeFinal=  (p_casaFinal.getColuna() + p_casaFinal.getLinha()) %2 ;
        int l_paridadeIncial = (p_casaInicial.getColuna() + p_casaInicial.getLinha()) %2 ;
        return (getParidade (p_casaInicial) == getParidade (p_casaFinal) ? true : false);
    }
    
    private int getParidade (Casa p_casaAtual)
    {
        return (p_casaAtual.getColuna() + p_casaAtual.getLinha()) %2 ;
    }
    
    private String montaStringPrincipal(Casa p_casaInicial, Casa p_casaFinal, String p_nomePeca , String p_corPeca) {
        
        return "/magchess10/ImagensTabuleiroPrincipal/" + p_nomePeca +p_corPeca+ getCorCasa(p_casaFinal) + ".jpg" ;
    }
    private String getCorCasa (Casa p_casaAtual)
    {
       return (getParidade(p_casaAtual) ==0 ? "Black" : "White" ); 
    }
    
    private String montaStringSecundario(Casa p_casaInicial, Casa p_casaFinal, String p_nomePeca , String p_corPeca) {
        String l_color = (c_casasTabuleiroSecundario[p_casaFinal.getLinha()][p_casaFinal.getColuna()].getBackground() == Color.BLACK ? "Black" : "White");
        return "/magchess10/ImagensTabuleiroSecundario/" + p_nomePeca +p_corPeca + l_color + ".jpg" ;
    }
    
    private int getXJogada(java.awt.event.MouseEvent evt) {
        return (evt.getX() - 70) / 50 ;
    }
    
    private int getYJogada(java.awt.event.MouseEvent evt) {
        return   7 - ((evt.getY() -30 ) / 50) ;
    }
    
    private boolean validarPosicaoClicadaTabuleiro(java.awt.event.MouseEvent evt) {
        if (evt.getX()>=70 && evt.getX() <=470 )
            if (evt.getY() >=30 && evt.getY() <=380)
                return true;
        return false;
    }
    
    private boolean validarPosicaoClicadaRepositorio(java.awt.event.MouseEvent evt) {
        if (evt.getX()>=20 && evt.getX() <=240 )
            if (evt.getY() >=20 && evt.getY() <=70)
                return true;
        return false;
    }
    
    private int getXJogadaRepositorio(java.awt.event.MouseEvent evt) {
        return (evt.getX()- 20 /50);
    }
    
    private void repJogador1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_repJogador1MouseClicked
       if (verificarTurnoJogadorAlvo(ControleJogo.JOGADORPRINCIPAL))
        if (validarPosicaoClicadaRepositorio(evt))
            getControleJogo().tratarRepositorio(getXJogadaRepositorio(evt));
    }//GEN-LAST:event_repJogador1MouseClicked
    
    private void jPanel10MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel10MouseClicked
      if (verificarTurnoJogadorAlvo(ControleJogo.JOGADORPRINCIPAL))
        if (validarPosicaoClicadaTabuleiro(evt))
            getControleJogo().tratarJogadaTabuleiro(getYJogada(evt),getXJogada(evt));
        
        
    }//GEN-LAST:event_jPanel10MouseClicked
    
    /**
     * @param args the command line arguments
     */
    
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel bispoJogador0;
    private javax.swing.JLabel bispoJogador1;
    private javax.swing.JLabel bispoJogador2;
    private javax.swing.JLabel bispoJogador3;
    private javax.swing.JButton btnDesistir;
    private javax.swing.JButton btnEmpate;
    private javax.swing.JButton btnEnviarMsg;
    private javax.swing.JButton btnSair;
    private javax.swing.JLabel cavaloJogador0;
    private javax.swing.JLabel cavaloJogador1;
    private javax.swing.JLabel cavaloJogador2;
    private javax.swing.JLabel cavaloJogador3;
    private javax.swing.JLabel damaJogador0;
    private javax.swing.JLabel damaJogador1;
    private javax.swing.JLabel damaJogador2;
    private javax.swing.JLabel damaJogador3;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel145;
    private javax.swing.JLabel jLabel146;
    private javax.swing.JLabel jLabel147;
    private javax.swing.JLabel jLabel148;
    private javax.swing.JLabel jLabel149;
    private javax.swing.JLabel jLabel150;
    private javax.swing.JLabel jLabel151;
    private javax.swing.JLabel jLabel152;
    private javax.swing.JLabel jLabel155;
    private javax.swing.JLabel jLabel169;
    private javax.swing.JLabel jLabel170;
    private javax.swing.JLabel jLabel171;
    private javax.swing.JLabel jLabel172;
    private javax.swing.JLabel jLabel173;
    private javax.swing.JLabel jLabel174;
    private javax.swing.JLabel jLabel175;
    private javax.swing.JLabel jLabel176;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel49;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel52;
    private javax.swing.JLabel jLabel53;
    private javax.swing.JLabel jLabel56;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel74;
    private javax.swing.JLabel jLabel75;
    private javax.swing.JLabel jLabel78;
    private javax.swing.JLabel jLabel79;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JLabel lbl2NomeJogador1;
    private javax.swing.JLabel lbl2NomeJogador2;
    private javax.swing.JLabel lbl2NomeJogador3;
    private javax.swing.JLabel lbl2NomeJogador4;
    private javax.swing.JLabel lblEhTurnoJogador1;
    private javax.swing.JLabel lblEhTurnoJogador2;
    private javax.swing.JLabel lblEhTurnoJogador3;
    private javax.swing.JLabel lblEhTurnoJogador4;
    private javax.swing.JTextField lblMsgBP;
    private javax.swing.JLabel lblNomeJogador1;
    private javax.swing.JLabel lblNomeJogador2;
    private javax.swing.JLabel lblNomeJogador3;
    private javax.swing.JLabel lblNomeJogador4;
    private javax.swing.JLabel lblTempoJogador0;
    private javax.swing.JLabel lblTempoJogador1;
    private javax.swing.JLabel lblTempoJogador2;
    private javax.swing.JLabel lblTempoJogador3;
    private javax.swing.JLabel lblTextoBP;
    private javax.swing.JLabel peaoJogador0;
    private javax.swing.JLabel peaoJogador1;
    private javax.swing.JLabel peaoJogador2;
    private javax.swing.JLabel peaoJogador3;
    private javax.swing.JLabel prinA1;
    private javax.swing.JLabel prinA2;
    private javax.swing.JLabel prinA3;
    private javax.swing.JLabel prinA4;
    private javax.swing.JLabel prinA5;
    private javax.swing.JLabel prinA6;
    private javax.swing.JLabel prinA7;
    private javax.swing.JLabel prinA8;
    private javax.swing.JLabel prinB1;
    private javax.swing.JLabel prinB2;
    private javax.swing.JLabel prinB3;
    private javax.swing.JLabel prinB4;
    private javax.swing.JLabel prinB5;
    private javax.swing.JLabel prinB6;
    private javax.swing.JLabel prinB7;
    private javax.swing.JLabel prinB8;
    private javax.swing.JLabel prinC1;
    private javax.swing.JLabel prinC2;
    private javax.swing.JLabel prinC3;
    private javax.swing.JLabel prinC4;
    private javax.swing.JLabel prinC5;
    private javax.swing.JLabel prinC6;
    private javax.swing.JLabel prinC7;
    private javax.swing.JLabel prinC8;
    private javax.swing.JLabel prinD1;
    private javax.swing.JLabel prinD2;
    private javax.swing.JLabel prinD3;
    private javax.swing.JLabel prinD4;
    private javax.swing.JLabel prinD5;
    private javax.swing.JLabel prinD6;
    private javax.swing.JLabel prinD7;
    private javax.swing.JLabel prinD8;
    private javax.swing.JLabel prinE1;
    private javax.swing.JLabel prinE2;
    private javax.swing.JLabel prinE3;
    private javax.swing.JLabel prinE4;
    private javax.swing.JLabel prinE5;
    private javax.swing.JLabel prinE6;
    private javax.swing.JLabel prinE7;
    private javax.swing.JLabel prinE8;
    private javax.swing.JLabel prinF1;
    private javax.swing.JLabel prinF2;
    private javax.swing.JLabel prinF3;
    private javax.swing.JLabel prinF4;
    private javax.swing.JLabel prinF5;
    private javax.swing.JLabel prinF6;
    private javax.swing.JLabel prinF7;
    private javax.swing.JLabel prinF8;
    private javax.swing.JLabel prinG1;
    private javax.swing.JLabel prinG2;
    private javax.swing.JLabel prinG3;
    private javax.swing.JLabel prinG4;
    private javax.swing.JLabel prinG5;
    private javax.swing.JLabel prinG6;
    private javax.swing.JLabel prinG7;
    private javax.swing.JLabel prinG8;
    private javax.swing.JLabel prinH1;
    private javax.swing.JLabel prinH2;
    private javax.swing.JLabel prinH3;
    private javax.swing.JLabel prinH4;
    private javax.swing.JLabel prinH5;
    private javax.swing.JLabel prinH6;
    private javax.swing.JLabel prinH7;
    private javax.swing.JLabel prinH8;
    private javax.swing.JPanel repJogador0;
    private javax.swing.JPanel repJogador1;
    private javax.swing.JPanel repJogador2;
    private javax.swing.JPanel repJogador3;
    private javax.swing.JLabel secA1;
    private javax.swing.JLabel secA2;
    private javax.swing.JLabel secA3;
    private javax.swing.JLabel secA4;
    private javax.swing.JLabel secA5;
    private javax.swing.JLabel secA6;
    private javax.swing.JLabel secA7;
    private javax.swing.JLabel secA8;
    private javax.swing.JLabel secB1;
    private javax.swing.JLabel secB2;
    private javax.swing.JLabel secB3;
    private javax.swing.JLabel secB4;
    private javax.swing.JLabel secB5;
    private javax.swing.JLabel secB6;
    private javax.swing.JLabel secB7;
    private javax.swing.JLabel secB8;
    private javax.swing.JLabel secC1;
    private javax.swing.JLabel secC2;
    private javax.swing.JLabel secC3;
    private javax.swing.JLabel secC4;
    private javax.swing.JLabel secC5;
    private javax.swing.JLabel secC6;
    private javax.swing.JLabel secC7;
    private javax.swing.JLabel secC8;
    private javax.swing.JLabel secD1;
    private javax.swing.JLabel secD2;
    private javax.swing.JLabel secD3;
    private javax.swing.JLabel secD4;
    private javax.swing.JLabel secD5;
    private javax.swing.JLabel secD6;
    private javax.swing.JLabel secD7;
    private javax.swing.JLabel secD8;
    private javax.swing.JLabel secE1;
    private javax.swing.JLabel secE2;
    private javax.swing.JLabel secE3;
    private javax.swing.JLabel secE4;
    private javax.swing.JLabel secE5;
    private javax.swing.JLabel secE6;
    private javax.swing.JLabel secE7;
    private javax.swing.JLabel secE8;
    private javax.swing.JLabel secF1;
    private javax.swing.JLabel secF2;
    private javax.swing.JLabel secF3;
    private javax.swing.JLabel secF4;
    private javax.swing.JLabel secF5;
    private javax.swing.JLabel secF6;
    private javax.swing.JLabel secF7;
    private javax.swing.JLabel secF8;
    private javax.swing.JLabel secG1;
    private javax.swing.JLabel secG2;
    private javax.swing.JLabel secG3;
    private javax.swing.JLabel secG4;
    private javax.swing.JLabel secG5;
    private javax.swing.JLabel secG6;
    private javax.swing.JLabel secG7;
    private javax.swing.JLabel secG8;
    private javax.swing.JLabel secH1;
    private javax.swing.JLabel secH2;
    private javax.swing.JLabel secH3;
    private javax.swing.JLabel secH4;
    private javax.swing.JLabel secH5;
    private javax.swing.JLabel secH6;
    private javax.swing.JLabel secH7;
    private javax.swing.JLabel secH8;
    private javax.swing.JLabel torreJogador0;
    private javax.swing.JLabel torreJogador1;
    private javax.swing.JLabel torreJogador2;
    private javax.swing.JLabel torreJogador3;
    // End of variables declaration//GEN-END:variables
    
    
    
    
    
}




